Objects Reference

flyEngine::step

Prototype

void step(int dt)
int step()

Parameters

Parameter Type Description
dt int elapsed time in ms

Return Value

Return the number of ms elapsed from last frame.

Remarks

This function is used to update the game after an elapsed time. The main loop from the frontend must call this function every frame. 

If called without the elapsed time, the elapsed time from last frame is computed, the scene is updated for the computed time interval and this interval is returned.

The following order of operations is performed inside this function:

1) Get current state for mouse and keyboard
2) For all light maps changed in the last frame, restore them to the original values.
3) For all fog maps changed in the last frame, clear them.
4) For each active object in the active objects linked list:
    if object life<0
        delete the object
    else 
        increment cur_step varaible
        call object step function
        if object step function returns true (moved), reposition it in the bsp
5) Increment cur_frame variable
6) For all light maps changed in this frame, update them to the texture manager
7) For all fog maps changed in this frame, update them to the texture manager
8) Send the FLYM_UPDATESCENE to all loaded plug-ins (some plug-ins will draw the scene here)
9) If multiplayer is on, call check_multiplayer for processing multiplayer messages.
10) If multiplayer is on and running on a client, check last player update message time and send a FLYM_MPUPDATE message to the plug-ins if the time from the last update is greater than the mpdelay variable
11) Calls the console step function